/**
 *  iBizSys 5.0 机器人生产代码（不要直接修改当前代码）
 *  http://www.ibizsys.net
 */
package com.sa.litetwo.srv.card.demodel;


import java.io.Serializable;
import java.util.ArrayList;
import org.hibernate.SessionFactory;
import net.ibizsys.paas.core.DEDataSetCond;
import net.ibizsys.paas.logic.ICondition;
import net.ibizsys.paas.core.IDEDataSetCond;
import net.ibizsys.paas.core.ISystem;
import net.ibizsys.paas.demodel.DEModelGlobal;
import net.ibizsys.paas.sysmodel.SysModelGlobal;
import net.ibizsys.paas.service.IService;
import net.ibizsys.paas.service.ServiceGlobal;
import net.ibizsys.paas.view.IView;
import net.ibizsys.paas.core.IDEFSearchMode;
import net.ibizsys.paas.core.IDEField;
import net.ibizsys.paas.demodel.DEFSearchModeModel;
import net.ibizsys.paas.demodel.DEFieldModel;
import net.ibizsys.paas.demodel.DEMainStateModel;
import net.ibizsys.paas.demodel.DEDataSyncModel;
import net.ibizsys.paas.demodel.DEActionWizardGroupModel;
import net.ibizsys.paas.demodel.DEActionWizardModel;
import net.ibizsys.paas.demodel.DEDataSetDEAWModel;
import net.ibizsys.paas.demodel.DEActionWizardItemModel;
import net.ibizsys.paas.demodel.IDEActionWizardModel;
import net.ibizsys.paas.core.IDEDataQuery;
import net.ibizsys.paas.core.IDEDataSet;
import net.ibizsys.paas.core.IDEAction;
import net.ibizsys.paas.core.IDEACMode;
import net.ibizsys.paas.core.IDELogic;
import net.ibizsys.paas.core.IDEUIAction;
import net.ibizsys.paas.core.IDEWF;
import net.ibizsys.paas.core.IDEMainState;
import net.ibizsys.paas.core.IDEDataImport;
import net.ibizsys.paas.report.IPrintService;
import net.ibizsys.paas.report.IReportService;
import net.ibizsys.paas.demodel.IDEDataExportModel;


import com.sa.litetwo.srv.liteTwoSysModel;

import com.sa.litetwo.srv.card.entity.GG_ATTACH;
import com.sa.litetwo.srv.card.service.GG_ATTACHService;


/**
 * 实体[GG_ATTACH]模型对象
 */
public class GG_ATTACHDEModel extends net.ibizsys.paas.demodel.DataEntityModelBase<GG_ATTACH>  {

   public GG_ATTACHDEModel() throws Exception {
        super();

        this.setId("13be8f96f05abeffb334eb4db6138c01");      
        this.setName("GG_ATTACH");      
        this.setTableName("T_GG_ATTACH");     
        this.setViewName("V_GG_ATTACH");     
        this.setLogicName("附件");     
        this.setDSLink("DEFAULT");
        this.setDataAccCtrlMode(1);
        this.setAuditMode(0);
        DEModelGlobal.registerDEModel("com.sa.litetwo.srv.card.demodel.GG_ATTACHDEModel",this);
        this.prepareModels();
 
       //注册到系统中 
        this.getliteTwoSysModel().registerDataEntityModel(this);
   }
   
	/**
     * 获取实体[GG_ATTACH]模型对象
     * @return
     * @throws Exception
     */   
    public static GG_ATTACHDEModel getInstance() throws Exception{
    	return (GG_ATTACHDEModel)DEModelGlobal.getDEModel(GG_ATTACHDEModel.class);
    } 
     
   
      private liteTwoSysModel liteTwoSysModel;
      /**
       * 获取当前系统[liteTwo]模型对象
       * @return
	   */
      public  liteTwoSysModel getliteTwoSysModel() {
           if(this.liteTwoSysModel==null)
           {
               try
                {
                      this.liteTwoSysModel = (liteTwoSysModel)SysModelGlobal.getSystem("com.sa.litetwo.srv.liteTwoSysModel");
                }
                catch(Exception ex)
                {
                }
           }       
           return this.liteTwoSysModel;
      }

      /* (non-Javadoc)
       * @see net.ibizsys.paas.demodel.DataEntityModelBase#getSystem()
       */
       @Override
       public  ISystem getSystem() {
        return this.getliteTwoSysModel();
       }

       private GG_ATTACHService gG_ATTACHService;

       /**
        * 获取实际实体服务对象
        * @return
        */
       public  GG_ATTACHService getRealService() {
         if(this.gG_ATTACHService==null){
                try
                {
                     this.gG_ATTACHService = (GG_ATTACHService)ServiceGlobal.getService(getServiceId());
                }
                catch(Exception ex)
                {
                }
            }
        return this.gG_ATTACHService;
    }
      
 	/* (non-Javadoc)
 	 * @see net.ibizsys.paas.demodel.IDataEntityModel#getService()
 	 */   
  	@Override
  	public IService getService()
  	{
  		return this.getRealService();
  	}
  
  	/* (non-Javadoc)
  	 * @see net.ibizsys.paas.demodel.IDataEntityModel#getServiceId()
  	 */
  	@Override
  	public String getServiceId()
  	{
  		return "com.sa.litetwo.srv.card.service.GG_ATTACHService";
  	}

       
	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.IDataEntityModel#createEntity()
	 */
	@Override
	public GG_ATTACH createEntity()
	{
		return new GG_ATTACH();
	}

	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEFields()
	 */
	@Override
	protected void prepareDEFields() throws Exception
	{
		IDEField iDEField = null;
		IDEFSearchMode iDEFSearchMode = null;
		//注册属性 "GG_ATTACHID"
		iDEField = this.createDEField("GG_ATTACHID");
		if(iDEField==null)
		{
			DEFieldModel deFieldModel = new DEFieldModel();
			deFieldModel.setDataEntity(this);
			deFieldModel.setId("2dbd106cad0540f5511502d148dd37ec");
			deFieldModel.setName("GG_ATTACHID");
			deFieldModel.setLogicName("附件标识");
			deFieldModel.setDataType("GUID");
			deFieldModel.setStdDataType(25);
			deFieldModel.setKeyDEField(true);
			deFieldModel.setImportOrder(1000);
			deFieldModel.setImportTag("");
			deFieldModel.setValueFormat("%1$s");
			deFieldModel.init();
			iDEField = deFieldModel;
		}
		this.registerDEField(iDEField);
		//注册属性 "GG_ATTACHNAME"
		iDEField = this.createDEField("GG_ATTACHNAME");
		if(iDEField==null)
		{
			DEFieldModel deFieldModel = new DEFieldModel();
			deFieldModel.setDataEntity(this);
			deFieldModel.setId("073d68a676e3401727a0cbd856b8d4cf");
			deFieldModel.setName("GG_ATTACHNAME");
			deFieldModel.setLogicName("附件名称");
			deFieldModel.setDataType("TEXT");
			deFieldModel.setStdDataType(25);
			deFieldModel.setMajorDEField(true);
			deFieldModel.setImportOrder(1000);
			deFieldModel.setImportTag("");
			deFieldModel.setValueFormat("%1$s");
			iDEFSearchMode = this.createDEFSearchMode(deFieldModel,"N_GG_ATTACHNAME_LIKE");
			if(iDEFSearchMode==null)
			{
				DEFSearchModeModel defSearchModeModel = new DEFSearchModeModel();
				defSearchModeModel.setDEField(deFieldModel);
				defSearchModeModel.setName("N_GG_ATTACHNAME_LIKE");
				defSearchModeModel.setValueOp("LIKE");
				defSearchModeModel.init();
				deFieldModel.registerDEFSearchMode(defSearchModeModel);
			}
			deFieldModel.init();
			iDEField = deFieldModel;
		}
		this.registerDEField(iDEField);
		//注册属性 "CREATEDATE"
		iDEField = this.createDEField("CREATEDATE");
		if(iDEField==null)
		{
			DEFieldModel deFieldModel = new DEFieldModel();
			deFieldModel.setDataEntity(this);
			deFieldModel.setId("caf9219ee46b75c8a5511e36b44d2b18");
			deFieldModel.setName("CREATEDATE");
			deFieldModel.setLogicName("建立时间");
			deFieldModel.setDataType("DATETIME");
			deFieldModel.setStdDataType(5);
			deFieldModel.setImportOrder(1000);
			deFieldModel.setImportTag("");
			deFieldModel.setPreDefinedType("CREATEDATE");
			deFieldModel.setValueFormat("%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS");
			deFieldModel.init();
			iDEField = deFieldModel;
		}
		this.registerDEField(iDEField);
		//注册属性 "CREATEMAN"
		iDEField = this.createDEField("CREATEMAN");
		if(iDEField==null)
		{
			DEFieldModel deFieldModel = new DEFieldModel();
			deFieldModel.setDataEntity(this);
			deFieldModel.setId("71a7d5cbc95580e6b413913448e17539");
			deFieldModel.setName("CREATEMAN");
			deFieldModel.setLogicName("建立人");
			deFieldModel.setDataType("TEXT");
			deFieldModel.setStdDataType(25);
			deFieldModel.setImportOrder(1000);
			deFieldModel.setImportTag("");
			deFieldModel.setPreDefinedType("CREATEMAN");
			deFieldModel.setCodeListId("com.sa.litetwo.srv.codelist.SysOperatorCodeListModel");
			deFieldModel.setValueFormat("%1$s");
			deFieldModel.init();
			iDEField = deFieldModel;
		}
		this.registerDEField(iDEField);
		//注册属性 "UPDATEDATE"
		iDEField = this.createDEField("UPDATEDATE");
		if(iDEField==null)
		{
			DEFieldModel deFieldModel = new DEFieldModel();
			deFieldModel.setDataEntity(this);
			deFieldModel.setId("813f6adcd35edd038e4c48f89ef5adf4");
			deFieldModel.setName("UPDATEDATE");
			deFieldModel.setLogicName("更新时间");
			deFieldModel.setDataType("DATETIME");
			deFieldModel.setStdDataType(5);
			deFieldModel.setImportOrder(1000);
			deFieldModel.setImportTag("");
			deFieldModel.setPreDefinedType("UPDATEDATE");
			deFieldModel.setValueFormat("%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS");
			deFieldModel.init();
			iDEField = deFieldModel;
		}
		this.registerDEField(iDEField);
		//注册属性 "UPDATEMAN"
		iDEField = this.createDEField("UPDATEMAN");
		if(iDEField==null)
		{
			DEFieldModel deFieldModel = new DEFieldModel();
			deFieldModel.setDataEntity(this);
			deFieldModel.setId("843daafc085a872c0326461d38e7258c");
			deFieldModel.setName("UPDATEMAN");
			deFieldModel.setLogicName("更新人");
			deFieldModel.setDataType("TEXT");
			deFieldModel.setStdDataType(25);
			deFieldModel.setImportOrder(1000);
			deFieldModel.setImportTag("");
			deFieldModel.setPreDefinedType("UPDATEMAN");
			deFieldModel.setCodeListId("com.sa.litetwo.srv.codelist.SysOperatorCodeListModel");
			deFieldModel.setValueFormat("%1$s");
			deFieldModel.init();
			iDEField = deFieldModel;
		}
		this.registerDEField(iDEField);
		//注册属性 "CARDID"
		iDEField = this.createDEField("CARDID");
		if(iDEField==null)
		{
			DEFieldModel deFieldModel = new DEFieldModel();
			deFieldModel.setDataEntity(this);
			deFieldModel.setId("126adf3865f7a6e6c7fad6b0fc4ef30c");
			deFieldModel.setName("CARDID");
			deFieldModel.setLogicName("人员");
			deFieldModel.setDataType("PICKUP");
			deFieldModel.setStdDataType(25);
			deFieldModel.setLinkDEField(true);
			deFieldModel.setImportOrder(1000);
			deFieldModel.setImportTag("");
			deFieldModel.setDERName("DER1N_GG_ATTACH_GG_CARD_CARDID");
			deFieldModel.setLinkDEFName("GG_CARDID");
			deFieldModel.setValueFormat("%1$s");
			iDEFSearchMode = this.createDEFSearchMode(deFieldModel,"N_CARDID_EQ");
			if(iDEFSearchMode==null)
			{
				DEFSearchModeModel defSearchModeModel = new DEFSearchModeModel();
				defSearchModeModel.setDEField(deFieldModel);
				defSearchModeModel.setName("N_CARDID_EQ");
				defSearchModeModel.setValueOp("EQ");
				defSearchModeModel.init();
				deFieldModel.registerDEFSearchMode(defSearchModeModel);
			}
			deFieldModel.init();
			iDEField = deFieldModel;
		}
		this.registerDEField(iDEField);
		//注册属性 "FJLX"
		iDEField = this.createDEField("FJLX");
		if(iDEField==null)
		{
			DEFieldModel deFieldModel = new DEFieldModel();
			deFieldModel.setDataEntity(this);
			deFieldModel.setId("af26d3898b8471bcc424f1d7c74c8fe2");
			deFieldModel.setName("FJLX");
			deFieldModel.setLogicName("附件类型");
			deFieldModel.setDataType("SSCODELIST");
			deFieldModel.setStdDataType(25);
			deFieldModel.setImportOrder(1000);
			deFieldModel.setImportTag("");
			deFieldModel.setCodeListId("com.sa.litetwo.srv.codelist.CLGG_FJLXCodeListModel");
			deFieldModel.setValueFormat("%1$s");
			iDEFSearchMode = this.createDEFSearchMode(deFieldModel,"N_FJLX_EQ");
			if(iDEFSearchMode==null)
			{
				DEFSearchModeModel defSearchModeModel = new DEFSearchModeModel();
				defSearchModeModel.setDEField(deFieldModel);
				defSearchModeModel.setName("N_FJLX_EQ");
				defSearchModeModel.setValueOp("EQ");
				defSearchModeModel.init();
				deFieldModel.registerDEFSearchMode(defSearchModeModel);
			}
			deFieldModel.init();
			iDEField = deFieldModel;
		}
		this.registerDEField(iDEField);
		//注册属性 "LJ"
		iDEField = this.createDEField("LJ");
		if(iDEField==null)
		{
			DEFieldModel deFieldModel = new DEFieldModel();
			deFieldModel.setDataEntity(this);
			deFieldModel.setId("063fc4339adcc4ac9df439e9f67946cb");
			deFieldModel.setName("LJ");
			deFieldModel.setLogicName("链接");
			deFieldModel.setDataType("TEXT");
			deFieldModel.setStdDataType(25);
			deFieldModel.setImportOrder(1000);
			deFieldModel.setImportTag("");
			deFieldModel.setValueFormat("%1$s");
			deFieldModel.init();
			iDEField = deFieldModel;
		}
		this.registerDEField(iDEField);
		//注册属性 "FJ"
		iDEField = this.createDEField("FJ");
		if(iDEField==null)
		{
			DEFieldModel deFieldModel = new DEFieldModel();
			deFieldModel.setDataEntity(this);
			deFieldModel.setId("a5cfb09d6b97624c19612e2eafff671c");
			deFieldModel.setName("FJ");
			deFieldModel.setLogicName("附件");
			deFieldModel.setDataType("LONGTEXT_1000");
			deFieldModel.setStdDataType(25);
			deFieldModel.setImportOrder(1000);
			deFieldModel.setImportTag("");
			deFieldModel.setValueFormat("%1$s");
			deFieldModel.init();
			iDEField = deFieldModel;
		}
		this.registerDEField(iDEField);
		//注册属性 "BZ"
		iDEField = this.createDEField("BZ");
		if(iDEField==null)
		{
			DEFieldModel deFieldModel = new DEFieldModel();
			deFieldModel.setDataEntity(this);
			deFieldModel.setId("8abdc2d559325009fb5283385284fa25");
			deFieldModel.setName("BZ");
			deFieldModel.setLogicName("备注");
			deFieldModel.setDataType("LONGTEXT_1000");
			deFieldModel.setStdDataType(25);
			deFieldModel.setImportOrder(1000);
			deFieldModel.setImportTag("");
			deFieldModel.setValueFormat("%1$s");
			deFieldModel.init();
			iDEField = deFieldModel;
		}
		this.registerDEField(iDEField);
		
	}
	        
  	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEACModes()
	 */
	@Override
	protected void prepareDEACModes() throws Exception
	{
               //注册  DEFAULT
               IDEACMode _defaultACModel = (IDEACMode)this.getliteTwoSysModel().createObject("com.sa.litetwo.srv.card.demodel.GG_ATTACHDefaultACModel");
               _defaultACModel.init(this);
               this.registerDEACMode(_defaultACModel);
	}


   	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEDataSets()
	 */
	@Override
	protected void prepareDEDataSets() throws Exception
	{
               //注册  DEFAULT
               IDEDataSet _defaultDSModel = (IDEDataSet)this.getliteTwoSysModel().createObject("com.sa.litetwo.srv.card.demodel.GG_ATTACHDefaultDSModel");
               _defaultDSModel.init(this);
               this.registerDEDataSet(_defaultDSModel);
	}




	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEDataQueries()
	 */
	@Override
	protected void prepareDEDataQueries() throws Exception
	{
               //注册  DEFAULT
              IDEDataQuery _defaultDQModel =(IDEDataQuery)this.getliteTwoSysModel().createObject("com.sa.litetwo.srv.card.demodel.GG_ATTACHDefaultDQModel");
               _defaultDQModel.init(this);
               this.registerDEDataQuery(_defaultDQModel);
	}

	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEActions()
	 */
	@Override
	protected void prepareDEActions() throws Exception
	{
		
	}

    /* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDELogics()
	 */
	@Override
	protected void prepareDELogics() throws Exception
	{
	}

	 /* (non-Javadoc)
	  * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEUIActions()
	 */
	@Override
	protected void prepareDEUIActions() throws Exception
	{
	}
	
    /* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEWFs()
	 */
	@Override
	protected void prepareDEWFs() throws Exception
	{
	}
	
	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEMainStates()
	 */
	@Override
	protected void prepareDEMainStates() throws Exception
	{
	}
	
	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEDataSyncs()
	 */
	@Override
	protected void prepareDEDataSyncs() throws Exception
	{
	}

	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#preparePDTDEViews()
	 */
	@Override
	protected void preparePDTDEViews() throws Exception
	{
         //注册视图 附件实体表格视图
         this.registerPDTDEView("MDATAVIEW","339cd58324aa28af9839d321262a1418");
         //注册视图 附件实体数据多项选择视图
         this.registerPDTDEView("MPICKUPVIEW","2a574d8f580aee3ef7788ddcd0c49008");
         //注册视图 附件实体数据选择视图
         this.registerPDTDEView("PICKUPVIEW","17fc8aa0dbed5b0dfae4b9f075dd78d8");
         //注册视图 附件实体数据重定向视图
         this.registerPDTDEView("REDIRECTVIEW","794e17dcb79ef778f9e16bf80ad0ba36");
	}
	
	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEOPPrivTagMaps()
	 */
	@Override
	protected void prepareDEOPPrivTagMaps()throws Exception
	{
	}
	
	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEPrints()
	 */
	@Override
	protected void prepareDEPrints()throws Exception
	{
	}
	
	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEReports()
	 */
	@Override
	protected void prepareDEReports()throws Exception
	{
	}
	
	
   	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEDataExports()
	 */
	@Override
	protected void prepareDEDataExports() throws Exception
	{
		
	}

	
	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEActionWizards()
	 */
	@Override
	protected void prepareDEActionWizards() throws Exception {
	}
	
	/* (non-Javadoc)
	 * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEActionWizardGroups()
	 */
	@Override
	protected void prepareDEActionWizardGroups() throws Exception {
	}
	
	
 
	/* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#onFillFetchQuickSearchConditions(net.ibizsys.paas.core.DEDataSetCond, java.lang.String)
     */
    @Override
	protected void onFillFetchQuickSearchConditions(DEDataSetCond groupCondImpl,String strQuickSearch)  throws Exception
	{
	    super.onFillFetchQuickSearchConditions(groupCondImpl,strQuickSearch);	

            //放入属性 GG_ATTACHNAME - 附件名称
	    if(true)
	    {
		DEDataSetCond deDataSetCondImpl = new DEDataSetCond();
		deDataSetCondImpl.setCondType(IDEDataSetCond.CONDTYPE_DEFIELD);
		deDataSetCondImpl.setCondOp(ICondition.CONDOP_LIKE);
		deDataSetCondImpl.setDEFName(GG_ATTACH.FIELD_GG_ATTACHNAME);
		deDataSetCondImpl.setCondValue(strQuickSearch);
		groupCondImpl.addChildDEDataQueryCond(deDataSetCondImpl);
	   }  
	} 
}